<template>
  <data-card :config="formConfig"></data-card>
</template>

<script>
  export default {
    name: "List",
    data() {
      return {
        formConfig: {
          title: '角色管理',
          fields: {
            id: {
              component: 'input',
              name: 'ID',
              type: 'number'
            },
            phone: {
              component: 'input',
              name: '手机号',
              type: 'number'
            },
            name: {
              component: 'input',
              name: '用户名',
              type: 'text'
            },
            status: {
              config: {
                options: {
                  normal: '正常',
                  delete: '已删除'
                }
              }
            },
            role: {
              component: 'select',
              name: '角色',
              type: 'select',
              config: {
                options: [
                  {
                    name: '管理员',
                    id: 'admin'
                  },
                  {
                    name: '普通用户',
                    id: 'user'
                  }
                ]
              }
            }
          },
          manage: {
            search: [],
            batch: [
              'status', 'edit', 'delete'
            ],
            columns: [
              {
                type: 'selection',
                width: 60,
                align: 'center'
              },
              {
                title: 'ID',
                key: 'id'
              }
            ],
            edit: 'model',
            add: 'model'
          },
          api: '/user'
        }
      }
    }
  }
</script>

<style scoped>

</style>